from PyQt4 import QtGui, QtCore

from FileManager import *
from ProjectManager import ProjectManager

class MainWindow( QtGui.QMainWindow ):
	
	fileManager = None
	projects	= None
	
	def __init__(self, initial_file=None, parent=None):
		QtGui.QMainWindow.__init__( self )
		
		self.resize(640, 512)
		
		self.setWindowTitle( "Skriv" )

		self.projects = ProjectManager( self )
		self.fileManager = FileManager( initial_file, self )

		self.setCentralWidget( self.fileManager )
		
		fileMenu = QtGui.QMenu(self.tr("&File"), self)
		self.fileManager.setupFileMenu( fileMenu )
		self.menuBar().addMenu( fileMenu )		

		projMenu = QtGui.QMenu(self.tr("&Projects"), self)
		self.projects.setupMenu( projMenu )
		self.menuBar().addMenu( projMenu )		
	
	def updateTitle( self, string ):
		self.setWindowTitle( string + " - Skriv" )
		
	def resetTitle( self ):
		self.setWindowTitle( "Skriv" )
